﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ScriptEditor.Commands
{
    class Command_ParamInit : Command
    {
        public string paramKey {
            get
            {
                return Value1;
            }
            set
            {
                Value1 = value;
            }
        }
        public TYPE type
        {
            get
            {
                return Enum.TryParse(Value2.ToUpper(), out TYPE result) ? result : TYPE.STRING;
            }
            set
            {
                Value2 = value.ToString().ToLower();
            }
        }
        public string defaultValue
        {
            get
            {
                return Value3;
            }
            set
            {
                Value3 = value;
            }
        }
        public Command_ParamInit()
        {
            CommandType = COMMANDTYPE.ParamInit;
            type = TYPE.STRING;
            defaultValue = "请输入变量初始值";
            Wait = false;
        }
        public Command_ParamInit(string Paramkey, TYPE Type, string DefaultValue)
        {
            CommandType = COMMANDTYPE.ParamInit;
            type = Type;
            defaultValue = DefaultValue;
            Wait = false;
        }
        public override string ToString()
        {
            return CommandType.ToString() + ":\n" + "创建变量:" + paramKey + " " + defaultValue;
        }
    }
}
